package com.dunshanasync.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dunshanasync.mapper.UserInfoMapper;
import com.dunshanasync.pojo.PageInstance;
import com.dunshanasync.service.UserInfoService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;

/**
 * @author liwen406
 * @program: dunshan-pef
 * @description:
 * @date 2021-08-14 10:55:11
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, PageInstance> implements UserInfoService {

    @Override
    public int saveAll() {
        ArrayList<PageInstance> objects = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            PageInstance pageInstance = new PageInstance();
            pageInstance.setPageId(i + 2L);
            pageInstance.setSite(i);
            pageInstance.setVenderId(100L);
            pageInstance.setShopId(100L);
            pageInstance.setChannelType(1);
            pageInstance.setPlatform(1);
            pageInstance.setThemeId(1L);
            pageInstance.setYn(1);
            pageInstance.setCreateTime(new Date());
            pageInstance.setModifyTime(new Date());
            objects.add(pageInstance);
        }
        baseMapper.insertBatch(objects);
        return 0;
    }

    @Override
    public int updateAll() {
        return 0;
    }
}
